package main

import (
	"errors"
	"fmt"
	"strings"
)

func validateArgs(name string) (ok bool, err error) {
	if strings.HasPrefix(name, "mysql") {
		return true, nil
	} else {
		return false, errors.New("name must start with mysql")
	}
}

func main() {
	s1 := "mysql-abc"
	s2 := "redis-abc"
	_, err := validateArgs(s1)
	if err != nil {
		fmt.Println("[s1 validate failed]", err)
	}

	_, err = validateArgs(s2)
	if err != nil {
		fmt.Println("[s2 validate failed]", err)
	}
}
